@use 'sass:color';
@use 'sass:map';
@use './assets/scss/variables' as *;

:root {
  font-family: system-ui, Avenir, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  font-weight: 400;
  color-scheme: light dark;
  color: $text-primary;
  background-color: $white;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  font-weight: 500;
  color: $primary-color;
  text-decoration: inherit;
  @include transition-base;
  
  &:hover {
    color: $primary-dark;
  }
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
}

h1 {
  font-size: $font-size-xl;
  line-height: 1.1;
  color: $text-primary;
  margin-bottom: $spacing-4;
}

button {
  border-radius: $border-radius;
  border: 1px solid $border-color;
  padding: $spacing-2 $spacing-4;
  font-size: $font-size-base;
  font-weight: 500;
  font-family: inherit;
  background-color: $white;
  cursor: pointer;
  @include transition-base;
  
  &:hover {
    border-color: $primary-color;
    background-color: $primary-light;
  }
  
  &:focus,
  &:focus-visible {
    outline: 2px solid $primary-color;
    outline-offset: 2px;
  }
}

.card {
  padding: $spacing-6;
  background-color: $white;
  border-radius: $border-radius-lg;
  box-shadow: $shadow;
  @include transition-base;
  
  &:hover {
    box-shadow: $shadow-lg;
  }
}

#app {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
}

@include respond-to('md') {
  h1 {
    font-size: $font-size-xl * 1.2;
  }
  
  .card {
    padding: $spacing-6 $spacing-8;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    color: $white;
    background-color: $text-primary;
  }
  
  button {
    background-color: $primary-dark;
    color: $white;
    
    &:hover {
      background-color: color.adjust($primary-dark, $lightness: 10%);
    }
  }
  
  .card {
    background-color: color.adjust($text-primary, $lightness: 5%);
  }
}
